<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:78:"D:\Code\matian\matian\application\admin\view\bootstrap\game_account\index.html";i:1498403768;}*/ ?>
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-lg-10">
        <h2>游戏账号信息表</h2>
        <ol class="breadcrumb">
            <li>
                <a href="#">首页</a>
            </li>

            <li class="active">
                <strong>游戏账号信息表</strong>
            </li>
        </ol>
    </div>

</div>

<div class="wrapper wrapper-content animated fadeInRight ecommerce">

    <div class="ibox-content m-b-sm border-bottom" id="form1">
        <div class="row">


                        <div class="col-sm-3">
                <div class="form-group">
                    <label class="control-label" for="is_stop">是否停用</label>

                    <?php echo W('parts/op',['key'=>'yn','name'=>'is_stop']); ?>
                                    </div>
            </div>

                        <div class="col-sm-3">
                <div class="form-group">
                    <label class="control-label" for="wait_transaction">待交易</label>
                    <?php echo W('parts/op',['key'=>'yn','name'=>'wait_transaction']); ?>
                                    </div>
            </div>
                        <div class="col-sm-3">
                <div class="form-group">
                    <label class="control-label" for="game_account_number">游戏账号</label>
                                        <input type="text" id="game_account_number" name="game_account_number" placeholder="游戏账号"
                           class="form-control">
                                    </div>
            </div>

                    </div>
        <div class="row">
            <div class="col-sm-6">
                <a class="btn btn-success btn-outline" href="#<?php echo U('form'); ?>">
                    <i class="fa fa-edit"></i>
                    <span class="bold">添加</span>
                </a>
            </div>
            <div class="col-sm-6 text-right">
                <button class="btn btn-default" data-op="reset">
                    <i class="fa fa-refresh"></i>
                    <span class="bold">重置</span>
                </button>
                &nbsp;
                &nbsp;
                <button class="btn btn-primary" data-op="search">
                    <i class="fa fa-search"></i>
                    <span class="bold">查询</span>
                </button>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-lg-12">
            <div class="ibox">
                <div class="ibox-content">
                    <table class="footable table table-stripped toggle-arrow-tiny" id="footable">
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    $(document).ready(function () {
        var table = YFootTable.create('#footable', {
            baseUrl: "<?php echo U('GameAccount/'); ?>",
            searchForm: '#form1',
            columns: [
                {name:'game_account_number',title:'游戏账号',sortable: true}
				,{name:'plateform_id',title:'对应平台账号id',sortable: true,breakpoints:'xs sm lg'}
				,{name:'create_date',title:'创建日期',sortable: true,breakpoints:'xs sm md'}
				,{name:'yn__is_stop',title:'是否停用',sortable: true,breakpoints:'xs sm md'}
				,{name:'stop_reason',title:'停用原因',sortable: true,breakpoints:'xs sm md'}
				,{name:'yn__wait_transaction',title:'待交易',sortable: true,breakpoints:'xs sm md'}
				,{name:'transaction_title',title:'待交易主题',sortable: true,breakpoints:'xs sm md'}
				,{name:'transaction_content',title:'待交易内容',sortable: true,breakpoints:'xs sm md'}
				,{name:'transaction_money',title:'交易金额',sortable: true,breakpoints:'xs sm md'}
                ,{name:'service_id',title:'区服id',sortable: true,breakpoints:'xs sm md'}
                ,{name:'transaction_img',title:'待交易账号截图',sortable: true,breakpoints:'xs sm lg',formatter:'image'}
            ],
            actions: [{
                text:'停用',
                token:'stop',
                handler:function(row){
                    if(row.is_stop == 1){
                        YMessager.alert('已停用');
                        return;
                    }
                    YMessager.confirm('是否确定停用',function () {
                        c.post("<?php echo U('stopUser'); ?>",{id:row.id,is_stop:1},function () {
                            table.loadData();
                        });
                    });
                }
            },{
                text:'启用',
                token:'stop',
                handler:function(row){
                    if(row.is_stop == 0){
                        YMessager.alert('已启用');
                        return;
                    }
                    debugger;
                    YMessager.confirm('是否确定启用',function () {
                        c.post("<?php echo U('stopUser'); ?>",{id:row.id,is_stop:0},function () {
                            table.loadData();
                        });
                    });
                }
            },'view', 'edit', 'remove']
        });
    });
</script>